#include"comm.hpp"
int main()
{
    key_t k = getKey();
    printf("key : %d\n",k);
    int shmid = creatShm(k);
    printf("shmid: %d\n",shmid);
    char* mem = (char*)attachShm(shmid);
    printf("attach success!address start :%p\n",mem);
    while(true)
    {
        //���ǽ�mem�������ַ�����
        shmid_ds shmds;
        shmctl(shmid,IPC_STAT,&shmds);
        printf("size : %d,creatpid: %d :mypid: %d,key:0x%x \n",shmds.shm_segsz,shmds.shm_cpid,getpid(),shmds.shm_perm.__key);
        sleep(1);
    }
    detachshm((void*)mem);
    sleep(2);
    delShm(shmid);
    return 0;
}